import wepy from 'wepy'

export const getToken = data => wepy.request({
  method: 'POST',
  url: '/token/gettoken',
  data
})

export const JudgeUserFen = data => wepy.request({
  method: 'POST',
  url: '/activity/join',
  data
})

export const getZhuanshuBoks = () => wepy.request(`/desk/madeBook`)

export const getWeekMoments = () => wepy.request('/moment/clockByDay')

export const getUserInfo = () => wepy.request('/user')

export const getQuestionList = (page = 1, size = 5) => wepy.request(`/question?page=${page}&size=${size}`)

export const getMyquestion = (page = 1, size = 5) => wepy.request(`/question/my?page=${page}&size=${size}`)

export const getQuetionDetail = id => wepy.request(`/question/${id}`)

export const askSameQuestion = data => wepy.request({
  method: 'POST',
  url: '/question/questionJoin',
  data
})

export const sendQuestion = data => wepy.request({
  method: 'POST',
  url: '/question',
  data
})

export const judegColection = data => wepy.request({
  method: 'POST',
  url: '/user/star',
  data
})

export const getCollection = (page = 1, size = 10) => wepy.request(`/user/starList?page=${page}&size=${size}`)

export const upUserInfo = data => wepy.request({
  method: 'POST',
  url: '/user/update',
  data
})

export const JoinComplete = data => wepy.request({
  url: '/activity/join',
  method: 'POST',
  data
})

export const CompalteAcit = data => wepy.request({
  url: '/activity/complete',
  method: 'POST',
  data
})

export const getLessionDiary = lessionid => wepy.request(`/moment/checkClockByUserId/${lessionid}`)

export const judgeUserVip = () => wepy.request('/user/vip')

export const getTodayDiary = id => wepy.request(`/moment/userClock/${id}?page=0&size=10`)

export const checkLookNumber = id => wepy.request(`/moment/checkClockView/${id}`)

export const getPoints = () => wepy.request('/share/shareList')

export const getNumberRe = id => wepy.request(`/share/userJoin/${id}`)

export const getMoreBooks = (page = 1) => wepy.request(`/book/userReadBook?page=${page}&size=6`)

export const checkHelpers = id => wepy.request(`/share/getHelpList/${id}`)

export const getGodParents = (size = 0) => wepy.request(`/desk/getSelectedParent?page=${size}&size=5`)

export const getBoksDetail = (id, page = 1) => wepy.request(`/book/getBook/${id}?page=${page}`)

export const getBoksUser = (id, page = 1, size = 6) => wepy.request(`/book/jieli/${id}?page=${page}&size=${size}`)

export const getColeList = (page = 1) => wepy.request(`/book/starList?page=${page}`)

export const getRank = (page = 1, size = 4) => wepy.request(`/book/rank?page=${page}&size=${size}`)

export const TogetherRead = (id, page = 1, size = 6) => wepy.request(`/book/publicRead/${id}?page=${page}&size=${size}`)

export const getPointList = (page = 1, size = 4) => wepy.request(`/user/ponitLog?page=${page}&size=4`)

export const getRenwuList = () => wepy.request(`/task/getTaskList`)

export const updateUserInfo = data => wepy.request({
  method: 'POST',
  url: '/user/update',
  data
})

export const storeColeBook = data => wepy.request({
  method: 'POST',
  url: '/book/star',
  data
})

export const getNumsFromFr = data => wepy.request({
  method: 'POST',
  url: '/share/shareUserClick',
  data
})

export const getQrcode = data => wepy.request({
  method: 'POST',
  url: '/wechat/createQrcode',
  data
})

export const getBackImg = () => wepy.request('/desk/getBaclGroupImage')

export const getUserFans = id => wepy.request(`/user/getUserFans/${id}`)

export const getUserMoments = (id, page = 1) => wepy.request(`/user/getList/${id}?page=${page}&size=10`)

export const getShow = () => wepy.request('/token/isshow')

export const getVerifyCode = data => wepy.request({
  method: 'POST',
  url: '/token/verificationCode',
  data
})

export const bindMobile = data => wepy.request({
  method: 'POST',
  url: '/user/bind',
  data
})

export const getFans = () => wepy.request('/user/fans')

export const getFocus = () => wepy.request('/user/focus')

export const getPublishedComment = (page = 1, size = 10) => wepy.request(`/user/publishcomment?page=${page}&size=${size}`)

export const getReceivedComment = (page = 1, size = 10) => wepy.request(`/user/receivedcomment?page=${page}&size=${size}`)

export const getReceivedThumb = () => wepy.request('/user/receivelike')

export const getPublishedThumb = () => wepy.request('/user/publishlike')

export const getRelated = () => wepy.request('/user/getfans')

export const getUploadBookList = (page = 1, size = 5) =>wepy.request(`/book/getUploadBookList?page=${page}&size=${size}`)

export const joinParty = () =>wepy.request(`/activity/list`)

export const getAddresList = () => wepy.request('/user/addresslist')

export const AddAdress = data => wepy.request({
  method: 'POST',
  url: '/user/address',
  data
})

export const deleteAdress = id => wepy.request({
  method: 'POST',
  url: `/user/address/delete/${id}`,
  data: id
})

export const upBoks = data => wepy.request({
  method: 'POST',
  url: '/book/uploadBook',
  data
})

export const updataUserAddress = (id, data) => wepy.request({
  method: 'POST',
  url: `/user/address/save/${id}`,
  data
})
